//
//  UserDetails.m
//  iCan - iPhone Context-Aware Navigation
//  Carnegie Mellon University - 18-842 Distributed Systems
//
//  Created by Andrew Santell on 3/26/12.
//  Copyright (c) 2012 Andrew Santell. All rights reserved.

/* View Controller that display User Details, when clicked on from the Search Users table */

#import "UserDetails.h"

@interface UserDetails ()

@end

@implementation UserDetails
@synthesize available, availableView;
@synthesize fName, fNameLabel;
@synthesize lName, lNameLabel;
@synthesize status, statusLabel;
@synthesize userName, userNameLabel;
@synthesize group, groupLabel;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    fNameLabel.text = fName;
    lNameLabel.text = lName;
    statusLabel.text = status;
    userNameLabel.text = userName;
    groupLabel.text = group;
  
    if (available == true)
        availableView.image = [UIImage imageNamed:@"green.png"];
    if (available == false)
        availableView.image = [UIImage imageNamed:@"red.png"];

}

- (void)viewDidUnload
{
    [self setFName:nil];
    [self setLName:nil];
    [self setStatus:nil];
    [self setUserName:nil];
    [self setGroup:nil];
    [self setFName:nil];
    [self setAvailableView:nil];
    [self setFNameLabel:nil];
    [self setLNameLabel:nil];
    [self setStatusLabel:nil];
    [self setUserNameLabel:nil];
    [self setGroupLabel:nil];
    
    [super viewDidUnload];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
